import axios from 'axios'
import BaseApi from '@/api/BaseApi'
import config from '@/config'

/**
 * 路由段接口
 */
export default class extends BaseApi {
  /**
   * 获取基础路径
   *
   * @return 基础路径
   */
  static basePath() {
    return (config.services.oen || '') + '/networkSegment'
  }
  static expTpl(params) {
    return axios.get(`${this.basePath()}/expTpl`, {
      params,
      headers: {
        'Content-Type': 'application/json; application/octet-stream'
      },
      responseType: 'blob'
    })
  }

  static expData(params) {
    return axios.get(`${this.basePath()}/expData`, {
      params,
      headers: {
        'Content-Type': 'application/json; application/octet-stream'
      },
      responseType: 'blob'
    })
  }
  // 获取列表
  static queryPage(params) {
    return axios.post(`${this.basePath()}/queryPage`, params)
  }
  // 获取全部列表
  static queryList(params) {
    return axios.post(`${this.basePath()}/queryList`, params)
  }
  // 删除网段
  static delBySegmentId(params) {
    return axios.delete(`${this.basePath()}/delBySegmentId`, { params })
  }
  // 获取单个网段详情
  static getBySegmentId(params) {
    return axios.get(`${this.basePath()}/getBySegmentId`, { params })
  }
}
